package com.jtny.nytb.equipment.service;


import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.jtny.nytb.equipment.vo.device.EquipmentInfoVO;
import com.jtny.nytb.equipment.vo.device.UserEquipmentQueryVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


/**
 * @author 智慧能源中心 - 车智斌
 * @package com.jtny.nytb.energymonitor.equipment.service
 * @fileName UserEquipmentRelationService.java
 * @createTime 2024年03月19日 10:26
 * @Copyright© 2024 jtny
 * 江投能源技术研究院 版权所有
 */
@Api(value = "用户设备关联Service接口", tags = "用户设备管理Service接口")
@ResponseBody
public interface UserEquipmentRelationService {

    @ApiOperation("根据用户code查询关联设备信息")
    @ApiImplicitParam(name = "userCodes", value = "角色code列表", required = true, paramType = "query")
    @ApiOperationSupport(order = 1)
    @PostMapping("/queryUserEquipmentRelationByCodes")
    List<UserEquipmentQueryVO> queryUserEquipmentRelationByCodes(@RequestBody List<String> userCodes);

    @ApiOperation("保存用户设备关联关系")
    @ApiImplicitParam(name = "userEquipmentRelationDTO", value = "角色设备关联信息", required = true, paramType = "query")
    @ApiOperationSupport(order = 2)
    @PostMapping("/insertUserEquipmentRelation")
    void insertUserEquipmentRelation(@RequestBody UserEquipmentQueryVO userEquipmentQueryVO);

    @ApiOperation("删除用户设备关联关系")
    @ApiImplicitParam(name = "userEquipmentRelationDTO", value = "角色设备关联信息", required = true, paramType = "query")
    @ApiOperationSupport(order = 3)
    @PostMapping("/deleteUserEquipmentRelation")
    void deleteUserEquipmentRelation(@RequestBody UserEquipmentQueryVO userEquipmentQueryVO);

    @ApiOperation("根据设备id查询关联设备信息")
    @ApiImplicitParam(name = "equipmentIds", value = "设备id列表", required = true, paramType = "query")
    @ApiOperationSupport(order = 4)
    @PostMapping("/queryUserEquipmentRelationByEquipmentIds")
    List<UserEquipmentQueryVO> queryUserEquipmentRelationByEquipmentIds(@RequestBody List<String> equipmentIds);

    /**
     * 获取当前角色绑定的设备信息
     * @return 设备信息列表
     */
    List<EquipmentInfoVO> queryEquipmentsByUser(UserEquipmentQueryVO userEquipmentQueryVO);

 }
